from selenium import webdriver
from selenium.webdriver import ActionChains
wd = webdriver.Chrome()
wd.get("http://weiban.mycourse.cn/index.html#/login")

while(1):

    input("回车")

    canvas = wd.find_element_by_id("canvas")
    maxX = int(canvas.get_attribute("width"))
    maxY = int(canvas.get_attribute("height"))
    print (maxX,maxY)
    flag = False
    for x in range(int(canvas.get_attribute("width")),0,-30):
            for y in range(int(canvas.get_attribute("height")),0,-30):
                    print(x,y)
                    actions = ActionChains(wd)
                    i= actions.move_to_element_with_offset(canvas,x,y)
                    actions.perform()
                    if(canvas.get_attribute("style").find("cursor") > -1):
                            print(x,y)
                            flag = True
                            actions.click()
                            i= actions.move_to_element(canvas)
                            actions.perform()
                            break
            if(flag):
                    break
